.. _ocaswitch: 1.1.1.4 OcaSwitch ================== Class Hierarchy: :ref:`OcaRoot ` : :ref:`OcaWorker ` : :ref:`OcaActuator ` : :ref:`OcaSwitch ` .. cpp:class:: OcaSwitch: OcaActuator (n)-position switch. Single-pole or multipole, as determined by number of input and output ports. May be instantiated with no ports for use as an option selector. **Properties**: .. _ocaswitch_classid: .. cpp:member:: static const OcaClassID ClassID = "1.1.1.4" Number that uniquely identifies the class. Note that this differs from the object number, which identifies the instantiated object. This property is an override of the **OcaRoot** property. This property has id ``1.1``. .. _ocaswitch_classversion: .. cpp:member:: static const OcaClassVersionNumber ClassVersion = 3 Identifies the interface version of the class. Any change to the class definition leads to a higher class version. This property is an override of the **OcaRoot** property. This property has id ``1.2``. .. _ocaswitch_position: .. cpp:member:: OcaUint16 Position The current position of the switch. Positions shall be numbered from **minPosition** to (including) **maxPosition**. If the object does not return the optional parameters **minPosition** and **maxPosition** in its **GetPosition** method, the positions shall be numbered from 1 to n. This property has id ``4.1``. .. _ocaswitch_positionenableflags: .. cpp:member:: OcaList PositionEnableFlags Vector of booleans which enable or disable corresponding switch positions. Default values are a construction parameter. The usual default value is True. Renamed to **PositionEnableFlags** in v3 of this class. This property has id ``4.3``. .. _ocaswitch_positionnames: .. cpp:member:: OcaList PositionNames Vector of switch position names. Defined at object construction time. In some implementations, may be changed by controller. FIrst element of list corresponds to the position value of **minPosition** as returned by **GetPosition(...)**. This property has id ``4.2``. Properties inherited from :ref:`ocaactuator`: - :cpp:texpr:`OcaClassID` :ref:`OcaRoot::ClassID ` - :cpp:texpr:`OcaClassVersionNumber` :ref:`OcaRoot::ClassVersion ` - :cpp:texpr:`OcaBoolean` :ref:`OcaRoot::Lockable ` - :cpp:texpr:`OcaLockState` :ref:`OcaRoot::LockState ` - :cpp:texpr:`OcaONo` :ref:`OcaRoot::ObjectNumber ` - :cpp:texpr:`OcaString` :ref:`OcaRoot::Role ` - :cpp:texpr:`OcaClassID` :ref:`OcaWorker::ClassID ` - :cpp:texpr:`OcaClassVersionNumber` :ref:`OcaWorker::ClassVersion ` - :cpp:texpr:`OcaBoolean` :ref:`OcaWorker::Enabled ` - :cpp:texpr:`OcaString` :ref:`OcaWorker::Label ` - :cpp:texpr:`OcaTimeInterval` :ref:`OcaWorker::Latency ` - :cpp:texpr:`OcaONo` :ref:`OcaWorker::Owner ` - :cpp:texpr:`OcaMap` :ref:`OcaWorker::PortClockMap ` - :cpp:texpr:`OcaList` :ref:`OcaWorker::Ports ` - :cpp:texpr:`OcaClassID` :ref:`OcaActuator::ClassID ` - :cpp:texpr:`OcaClassVersionNumber` :ref:`OcaActuator::ClassVersion ` **Methods**: .. _ocaswitch_getposition: .. cpp:function:: OcaStatus GetPosition(OcaUint16 &position, OcaUint16 &minPosition, OcaUint16 &maxPosition) Gets the value and limits of the **Position** property. This method has id ``4.1``. - :cpp:expr:`position`: Output parameter. - :cpp:expr:`minPosition`: Output parameter. - :cpp:expr:`maxPosition`: Output parameter. .. _ocaswitch_setposition: .. cpp:function:: OcaStatus SetPosition(OcaUint16 position) Sets the value of the Position property. This method has id ``4.2``. - :cpp:expr:`position`: Input parameter. .. _ocaswitch_getpositionname: .. cpp:function:: OcaStatus GetPositionName(OcaUint16 Index, OcaString &Name) Gets the name assigned to a given switch position. This method has id ``4.3``. - :cpp:expr:`Index`: Input parameter. - :cpp:expr:`Name`: Output parameter. .. _ocaswitch_setpositionname: .. cpp:function:: OcaStatus SetPositionName(OcaUint16 Index, OcaString Name) Assigns a name to a given switch position. This method has id ``4.4``. - :cpp:expr:`Index`: Input parameter. - :cpp:expr:`Name`: Input parameter. .. _ocaswitch_getpositionnames: .. cpp:function:: OcaStatus GetPositionNames(OcaList &Names) Gets list of names assigned to the switch's positions. This method has id ``4.5``. - :cpp:expr:`Names`: Output parameter. .. _ocaswitch_setpositionnames: .. cpp:function:: OcaStatus SetPositionNames(OcaList Names) Assigns names to the switch's positions. This method has id ``4.6``. - :cpp:expr:`Names`: Input parameter. .. _ocaswitch_getpositionenableflag: .. cpp:function:: OcaStatus GetPositionEnableFlag(OcaUint16 Index, OcaBoolean &Enabled) Gets the Enabled flag assigned to a given switch position. This method has id ``4.7``. - :cpp:expr:`Index`: Input parameter. - :cpp:expr:`Enabled`: Output parameter. .. _ocaswitch_setpositionenableflag: .. cpp:function:: OcaStatus SetPositionEnableFlag(OcaUint16 Index, OcaBoolean enabled) Sets the Enabled flag assigned to a given switch position. This method has id ``4.8``. - :cpp:expr:`Index`: Input parameter. - :cpp:expr:`enabled`: Input parameter. .. _ocaswitch_getpositionenableflags: .. cpp:function:: OcaStatus GetPositionEnableFlags(OcaList &flags) Gets list of position-enabled flags assigned to the switch's positions. This method has id ``4.9``. - :cpp:expr:`flags`: Output parameter. .. _ocaswitch_setpositionenableflags: .. cpp:function:: OcaStatus SetPositionEnableFlags(OcaList flags) Sets list of position-enable flags for the switch's positions. This method has id ``4.10``. - :cpp:expr:`flags`: Input parameter. Methods inherited from :ref:`ocaactuator`: - :ref:`OcaActuator::GetClassIdentification ` - :ref:`OcaActuator::GetLockable ` - :ref:`OcaActuator::GetLockState ` - :ref:`OcaActuator::GetRole ` - :ref:`OcaActuator::SetLockNoWrite ` - :ref:`OcaActuator::SetLockNoReadWrite ` - :ref:`OcaActuator::Unlock ` - :ref:`OcaActuator::AddPort ` - :ref:`OcaActuator::DeletePort ` - :ref:`OcaActuator::DeletePortClockMapEntry ` - :ref:`OcaActuator::GetEnabled ` - :ref:`OcaActuator::GetLabel ` - :ref:`OcaActuator::GetLatency ` - :ref:`OcaActuator::GetOwner ` - :ref:`OcaActuator::GetPath ` - :ref:`OcaActuator::GetPortClockMap ` - :ref:`OcaActuator::GetPortClockMapEntry ` - :ref:`OcaActuator::GetPortName ` - :ref:`OcaActuator::GetPorts ` - :ref:`OcaActuator::SetEnabled ` - :ref:`OcaActuator::SetLabel ` - :ref:`OcaActuator::SetLatency ` - :ref:`OcaActuator::SetPortClockMap ` - :ref:`OcaActuator::SetPortClockMapEntry ` - :ref:`OcaActuator::SetPortName `